import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/authentication/login',
    method: 'post', //post
    data
  })
}

export function getInfo() {
  return request({
    url: '/admin/authentication/info',
    method: 'get'
  })
}




export function bindRoles(data) {
  return request({
    url: '/admin/user/bindRole',
    method: 'post',
    data
  })
}



export function restore(id) {
  return request({
    url: `/admin/user/restore/${id}`,
    method: 'get'
  })
}

export function deletes(id) {
  return request({
    url: `/admin/user/delete/${id}`,
    method: 'get'
  })
}

export const getDetail = (id) => {
  return request({
    url: `/admin/user/detail/${id}`,
    method: 'get'
  })
}

/**
 * 查询分页
 */
 export const queryData = (data) => {
  return request({
    url: '/admin/user/query',
    method: 'post',
    data
  })
}

export const add = (data) => {
  return request({
    url: '/admin/user/add',
    method: 'post',
    data
  })
}

export const save = (data) => {
  return request({
    url: '/admin/user/update',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/admin/user/logout',
    method: 'post'
  })
}
